import { Component } from 'react';
import { NavBar } from 'antd-mobile';
import { withRouter } from 'react-router-dom';
import './index.scss';
import Proptypes from 'prop-types';


class myNavBar extends Component {
  static propTypes = {
    children: Proptypes.string.isRequired,
  };
  render() {
    return (
      <NavBar
        style={{ position: 'fixed', top: 0, width: '100%' }}
        id='navBar'
        mode='light'
        icon={<i className='iconfont icon-back'></i>}
        onLeftClick={() => this.props.history.go(-1)}
      >
        {this.props.children}
      </NavBar>
    );
  }
}

export default withRouter(myNavBar);
